define( [
		'module',
		'backbone',
		'marionette',
		'text!templates/itemView.html', 
		],
function( module, Backbone, Marionette, ItemHTML ) {
	console.log("Loading module " + module.id + " from " + module.uri + "...");

	var GridRow = Backbone.Marionette.ItemView.extend({
//		template: "#row-template",
//		tagName: "tr"
//		template: "#item-view",
		template: undefined,
		tagName:"div",
		className:"bookContainer",

		initialize: function() {
			console.log("GridRow: initialize - entry");
			this.template = _.template(ItemHTML)
		},
		/* get the template from external file, do not polute
		 * the main page with template snippets
		 */

		deleteBook:function(e) {
			console.log(e);
			this.model.destroy();
			this.remove();
		},

		events: {
			"click .remove_a_book":"deleteBook" 
		}
	});

	return GridRow;
});
